<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../js/jquery-1.12.4.min.js"></script>
    <script>
        $(function () {
            const $a = $('#link1');

            // 读取属性值
            const sId = $a.prop('id');
            // alert(sId);

            //设置属性值
            $a.prop({'href':'https://home.firefoxchina.cn/'});
            $a.html('<ul><li>1</li><li>2</li><li>3</li></ul>')

        })


    </script>
</head>
<body>
    <a href="#" id="link1">这是一个连接</a>
</body>
</html>